//
//  WJBaseTableView.m
//  WJBSApp
//
//  Created by dllo on 16/7/13.
//  Copyright © 2016年 王景伟. All rights reserved.
//

#import "WJBaseTableView.h"

@implementation WJBaseTableView

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
    self = [super initWithFrame:frame style:style];
    if (self) {
        [self changeColor];
        // 创建观察者
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor) name:@"changeColor" object:nil];
        self.separatorStyle = UITableViewCellSeparatorStyleNone;
        
    }
    return self;
}
- (void)changeColor {
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
        self.backgroundColor = FORBLACKCOLOR;
    }else{
        self.backgroundColor = LABLECOLOR;
    }
}

// 销毁观察者
- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}











@end
